<?php

	require_once('../../includes/bootstrap.php');
	
	if(isset($_POST['password']))
	{
		$salt = random_string();
		$hash = $users->hash($_POST['password'], $salt);
		
		echo(
			'<pre>' . PHP_EOL . 
			'Password	' . $_POST['password'] . PHP_EOL . 
			'Salt		' . $salt . PHP_EOL . 
			'Hash Value	' . $hash . PHP_EOL . PHP_EOL . 
			'UPDATE `' . PREFIX . 'users` SET `password` = \'' . $hash . '\', `salt` = \'' . $salt . '\' WHERE `id` = </pre>' . PHP_EOL . 
			'</pre>' . PHP_EOL 
		);
	}
	
	echo(
		'<form method="post" action="">
			<h3>Password Encryption</h3>
			<input type="password" name="password" /> <input type="submit" value="Encrypt" />
		</form>' . PHP_EOL 
	);

?>